import request from './public'
// 商品列表
export const getAllGoods = (params) => {
  return request.get('/single/pms/goods/list', params)
}
// 团购列表
export const getAllGroupActivity = (params) => {
  return request.get('/single/pms/groupHotGoods/list', params)
}
// 商品详情
export const productDet = (params) => {
  return request.get('/single/pms/goods/detail', params)
}
// 商品团购详情
export const productGroupDet = (params) => {
  return request.get('/single/pms/goodsGroup/detail', params)
}
// 获取购物车列表
export const getCartList = (params) => {
  return request.get('/cart/list', params)
}
// 加入购物车
export const addCart = (params) => {
  return request.post('/cart/addCart', params)
}
// 删除购物车
export const delCart = (params) => {
  return request.post('/cart/delete', params)
}
// 删除购物车勾选商品
export const delCartChecked = (params) => {
  return request.get('/cart/delCartChecked', params)
}
// 编辑购物车
export const cartEdit = (params) => {
  return request.post('/cart/update/quantity', params)
}
// 全选
export const editCheckAll = (params) => {
  return request.post('/cart/update/quantity', params)
}
// 删除整条购物车
export const clearCart = (params) => {
  return request.post('/cart/clear', params)
}
// 获取用户地址
export const addressList = (params) => {
  return request.get('/address/list', params)
}
// 通过id获取地址
export const getAddress = (params) => {
  return request.get('/address/getItemDefautl', params)
}
// 设为默认
export const addressUpdate = (params) => {
  return request.post('/address/address-set-default', params)
}
// 添加收货地址
export const addressAdd = (params) => {
  return request.post('/address/save', params)
}
// 删除收货地址
export const addressDel = (params) => {
  return request.get('/address/delete', params)
}
// 预览订单
export const submitPreview = (params) => {
  return request.get('/single/oms/submitPreview', params)
}
// 生成订单
export const submitOrder = (params) => {
  return request.get('/single/oms/generateOrder', params)
}
// 预览订单
export const submitStorePreview = (params) => {
  return request.get('/single/oms/submitStorePreview', params)
}
// 生成订单
export const generateStoreOrder = (params) => {
  return request.get('/single/oms/generateStoreOrder', params)
}
// pcPay: 'aliPay/pcPay', // 支付宝支付
export const payMent = (params) => {
  return request.get('/aliPay/pcPay', params)
}
// scanCode1 扫码支付模式一  wechat
export const scanCode1 = (params) => {
  return request.get('/wxPay/scanCode1', params)
}
// 获取用户订单
export const orderList = (params) => {
  return request.get('/single/oms/order/list', params)
}
// 获取单个订单详情
export const getOrderDet = (params) => {
  return request.get('/single/oms/detail', params)
}
// 取消订单
export const cancelOrder = (params) => {
  return request.get('/single/oms/closeOrder', params)
}

// 删除订单
export const delOrder = (params) => {
  return request.get('/single/oms/deleteOrder', params)
}
// 添加售后
export const saveOmsOrderReturnApply = (params) => {
  return request.post('/single/oms/saveOmsOrderReturnApply', params)
}
		 // 查询售后列表
		export const aftersaleslist = (params) => {
      return request.get('/single/oms/order/aftersaleslist', params)
    }
	 // 查询售后详情
		export const aftersalesinfo = (params) => {
      return request.get('/single/oms/order/aftersalesinfo', params)
    }


// 商品列表
export const getSearch = (params) => {
  return request.get('/goods.getlist', params)
}
// 快速搜索
export const getQuickSearch = (params) => {
  return request.get('/goods.getlist', params)
}

/**
 * 生成支付二维码（模式一）并在页面上显示
 */
export const scanCode = (params) => {
  return request.get('/wxpay/scanCode1', params)
}
/**
 * 扫码支付模式二
 * 已测试
 */
export const scanCode2 = (params) => {
  return request.get('/wxpay/scanCode2', params)
}


/**
 * 刷卡支付
 * 已测试
 */
export const micropay = (params) => {
  return request.get('/wxpay/micropay', params)
}
